package com.ll.stringbufferdemo;

import java.util.Scanner;

/**
 * @author 刘龙
 * @version 1.0
 */
public class StringBuffer04 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String price = "12355555555555567.89";
        StringBuffer stringBuffer = new StringBuffer(price);
        for (int i = stringBuffer.indexOf(".") - 3; i > 0; i -= 3) {
            stringBuffer.insert(i,",");
        }
        System.out.println(stringBuffer);
//        int indexOf = stringBuffer.indexOf(".");
//        stringBuffer.insert(indexOf-3,",");
//        System.out.println(stringBuffer);

    }
}
